'\" te
.\" Copyright (c) 1994, Sun Microsystems, Inc. All Rights Reserved.
.\"  Copyright (c) 1983 Regents of the University of California.  All rights reserved.  The Berkeley software License Agreement specifies the terms and conditions for redistribution.
.TH VGRINDEFS 7 "Aug 10, 1994"
.SH NAME
vgrindefs \- vgrind's language definition data base
.SH SYNOPSIS
.LP
.nf
\fB/usr/lib/vgrindefs\fR
.fi

.SH DESCRIPTION
.sp
.LP
\fBvgrindefs\fR contains all language definitions for \fBvgrind\fR(1).
Capabilities in \fBvgrindefs\fR are of two types: Boolean capabilities which
indicate that the language has some particular feature and string capabilities
which give a regular expression or keyword list. Entries may continue onto
multiple lines by giving a \e as the last character of a line. Lines starting
with # are comments.
.SS "Capabilities"
.sp
.LP
The following table names and describes each capability.
.sp

.sp
.TS
box;
c | c | c
l | l | l .
Name	Type	Description
_
\fBab\fR	\fBstr\fR	T{
Regular expression for the start of an alternate form comment
T}
_
\fBae\fR	\fBstr\fR	T{
Regular expression for the end of an alternate form comment
T}
_
\fBbb\fR	\fBstr\fR	T{
Regular expression for the start of a block
T}
_
\fBbe\fR	\fBstr\fR	T{
Regular expression for the end of a lexical block
T}
_
\fBcb\fR	\fBstr\fR	T{
Regular expression for the start of a comment
T}
_
\fBce\fR	\fBstr\fR	T{
Regular expression for the end of a comment
T}
_
\fBid\fR	\fBstr\fR	T{
String giving characters other than letters and digits that may legally occur in identifiers (default `_')
T}
_
\fBkw\fR	\fBstr\fR	A list of keywords separated by spaces
_
\fBlb\fR	\fBstr\fR	T{
Regular expression for the start of a character constant
T}
_
\fBle\fR	\fBstr\fR	T{
Regular expression for the end of a character constant
T}
_
\fBoc\fR	\fBbool\fR	T{
Present means upper and lower case are equivalent
T}
_
\fBpb\fR	\fBstr\fR	T{
Regular expression for start of a procedure
T}
_
\fBpl\fR	\fBbool\fR	T{
Procedure definitions are constrained to the lexical level matched by the `px' capability
T}
_
\fBpx\fR	\fBstr\fR	T{
A match for this regular expression indicates that procedure definitions may occur at the next lexical level. Useful for lisp-like languages in which procedure definitions occur as subexpressions of defuns.
T}
_
\fBsb\fR	\fBstr\fR	T{
Regular expression for the start of a string
T}
_
\fBse\fR	\fBstr\fR	T{
Regular expression for the end of a string
T}
_
\fBtc\fR	\fBstr\fR	T{
Use the named entry as a continuation of this one
T}
_
\fBtl\fR	\fBbool\fR	T{
Present means procedures are only defined at the top lexical level
T}
.TE

.SS "Regular Expressions"
.sp
.LP
\fBvgrindefs\fR uses regular expressions similar to those of \fBex\fR(1) and
\fBlex\fR(1). The characters `^', `$', `:', and `\e' are reserved characters
and must be `quoted' with a preceding \e if they are to be included as normal
characters. The metasymbols and their meanings are:
.sp
.ne 2
.na
\fB\fB$\fR\fR
.ad
.RS 7n
The end of a line
.RE

.sp
.ne 2
.na
\fB\fB^\fR\fR
.ad
.RS 7n
The beginning of a line
.RE

.sp
.ne 2
.na
\fB\fB\ed\fR\fR
.ad
.RS 7n
A delimiter (space, tab, newline, start of line)
.RE

.sp
.ne 2
.na
\fB\fB\ea\fR\fR
.ad
.RS 7n
Matches any string of symbols (like `.*' in lex)
.RE

.sp
.ne 2
.na
\fB\fB\ep\fR\fR
.ad
.RS 7n
Matches any identifier. In a procedure definition (the `pb' capability) the
string that matches this symbol is used as the procedure name.
.RE

.sp
.ne 2
.na
\fB\fB()\fR\fR
.ad
.RS 7n
Grouping
.RE

.sp
.ne 2
.na
\fB\fB|\fR\fR
.ad
.RS 7n
Alternation
.RE

.sp
.ne 2
.na
\fB\fB?\fR\fR
.ad
.RS 7n
Last item is optional
.RE

.sp
.ne 2
.na
\fB\fB\ee\fR\fR
.ad
.RS 7n
Preceding any string means that the string will not match an input string if
the input string is preceded by an escape character (\e). This is typically
used for languages (like C) that can include the string delimiter in a string
by escaping it.
.RE

.sp
.LP
Unlike other regular expressions in the system, these match words and not
characters. Hence something like `(tramp|steamer)flies?' would match `tramp',
`steamer', `trampflies', or `steamerflies'. Contrary to some forms of regular
expressions, \fBvgrindef\fR alternation binds very tightly. Grouping
parentheses are likely to be necessary in expressions involving alternation.
.SS "Keyword List"
.sp
.LP
The keyword list is just a list of keywords in the language separated by
spaces. If the `oc' boolean is specified, indicating that upper and lower case
are equivalent, then all the keywords should be specified in lower case.
.SH EXAMPLES
.LP
\fBExample 1 \fRA sample program.
.sp
.LP
The following entry, which describes the C language, is typical of a language
entry.

.sp
.in +2
.nf
C|c|the C programming language:\e
    :pb=^\ed?*?\ed?\ep\ed?(\ea?\e)(\ed|{):bb={:be=}:cb=/*:ce=*/:sb=":se=\ee":\e
    :le=\ee':tl:\e
    :kw=asm auto break case char continue default do double else enum\e
    extern float for fortran goto if int long register return short\e
    sizeof static struct switch typedef union unsigned void while #define\e
    #else #endif #if #ifdef #ifndef #include #undef # define endif\e
    ifdef ifndef include undef defined:
.fi
.in -2
.sp

.sp
.LP
Note that the first field is just the language name (and any variants of it).
Thus the C language could be specified to \fBvgrind\fR(1) as `c' or `C'.

.SH FILES
.sp
.ne 2
.na
\fB\fB/usr/lib/vgrindefs\fR\fR
.ad
.RS 22n
file containing vgrind descriptions
.RE

.SH SEE ALSO
.sp
.LP
.BR ex (1),
.BR lex (1),
.BR troff (1),
.BR vgrind (1)
